﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Netweight : MonoBehaviour {


    //连接绳子的末端(即将网挂在绳子的末端)
    private float linedistance = 0.3f;

    public void ConnectRig(Rigidbody2D rig)
    {
        var honkjoit = gameObject.AddComponent<HingeJoint2D>();
        honkjoit.autoConfigureConnectedAnchor = false;
        honkjoit.connectedBody = rig;
        honkjoit.anchor = Vector2.zero;
        honkjoit.connectedAnchor = new Vector2(0, -linedistance);
    }
}
